﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace Nhom16_PTTKHTTT_12HCB
{
    public partial class frmLoaiVe : Form
    {
        
   
        public frmLoaiVe()
        {
            InitializeComponent();
        }

        private void frmLoaiVe_Load(object sender, EventArgs e)
        {
            //DanhSachLoaiVe();
        }

        public void DanhSachLoaiVe()
        {            
            //LoaiVe_BUS lv = new LoaiVe_BUS();
            //DataTable dt = new DataTable();
            //dt = lv.DanhSachLoaiVe();
            //dgvLoaiVe.AutoGenerateColumns = false;
            //dgvLoaiVe.DataSource = dt;
        }

        public void frmKhiLoaiVeThayDoi()
        {
            //DanhSachLoaiVe();
        }
        
        frmThem_Sua_LoaiVe frmThemSuaLoaiVe;
        private void btnThem_Click(object sender, EventArgs e)
        {
            //frmThemSuaLoaiVe = new frmThem_Sua_LoaiVe();
            //frmThemSuaLoaiVe.KhiThemMoiLoaiVe += frmKhiLoaiVeThayDoi;
            //frmThemSuaLoaiVe.Action = "insert";
            //frmThemSuaLoaiVe.ShowDialog();
        }
        
        private void btnXoa_Click(object sender, EventArgs e)
        {
            //LoaiVe_BUS lv = new LoaiVe_BUS();
            //string ma = dgvLoaiVe.CurrentRow.Cells["MaLoaiVe"].Value.ToString();
            //lv.XoaLoaiVe(ma);
            //DanhSachLoaiVe();
        }
        
        private void btnSua_Click(object sender, EventArgs e)
        {
            //string ma = dgvLoaiVe.CurrentRow.Cells["MaLoaiVe"].Value.ToString();
            //frmThemSuaLoaiVe = new frmThem_Sua_LoaiVe();
            //frmThemSuaLoaiVe.ID = ma;
            //frmThemSuaLoaiVe.KhiCapNhatLoaiVe += frmKhiLoaiVeThayDoi;
            //frmThemSuaLoaiVe.Action = "edit";
            //frmThemSuaLoaiVe.ShowDialog();
        }

        private void dgvLoaiVe_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //if (e.RowIndex > -1)
            //{
            //    string command = dgvLoaiVe.Columns[e.ColumnIndex].Name;
            //    if (command == "buttona") // colbtn là tên cột chứa button
            //    {
            //        // gọi form ở trong này
            //        MessageBox.Show("2");
            //    }
            //}
        }

        private void groupPanel6_Click(object sender, EventArgs e)
        {

        }
    }
}
